home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D Speech Pack / 4D Speech Pack.rsrc / TEXT_28805_†SP Open Voice.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  2.5 KB  |  38 lines

  1. SP Open Voice (voice; reference) -> err
  2.  
  3. voice          string (63) specifys the voice you want to use.
  4. reference   integer       returns a number you need with other functions
  5.                                    to specify which channel you want to operate on.
  6.                                    Returns zero if an error occured.
  7. err             integer       returns the error which occured. 
  8.                                     A value of zero indicates no error occured. See 
  9.                                     below for a list of possible errors.
  10.  
  11. Sets up a speech channel and returns a reference number for you to use later with other functions, i.e. to specify text you want to be spoken.
  12.  
  13. There can be a maximum of ten open speech channels, if you try to open more an error will be returned (-241). This is a limit imposed by the external and can easily be increased but it seems enough to me. The number of open channels is also limited to the memory available, and this limit can be reached before the maximum number of channels. You are allowed to open more than one channel using the same voice.
  14. Do not save the reference anywere because it is only valid until the speech channel is closed (except with SP Voice busy). Also don't assume it will always be a number within a certain range, this has changed in the past and may change again in the future. But it is save to assume a valid reference value will be anything but zero. If you try to open a speech channel (e.g. in the startup procedure) and this fails an error will be returned and the reference value will be set to zero so you can test for this later.
  15. With every voice you open the external attaches a dictionary to the speech channel. If the external only fails to open the dictionary no error will be returned.
  16.  
  17. Use SP  Close Voice to dispose the speech channel opened with SP OpenVoice.
  18.  
  19. Examples:
  20.   `if you use one of these in the Startup procedure you can use 
  21.   `$speechref anywere in the data-base to speak the text
  22.   $err := SP Open Voice ("*"; $speechref)
  23.   $err := SP Open Voice ("Marvin"; $speechref)
  24.   $err := SP Open Voice ($voicename; $speechref)
  25.  
  26. Possible errors:
  27.         0  No Error
  28.       -4  Speech Pack can not be used (Speech Mgr not available)
  29.     -50  Parameter error (inside external, not necessarily the
  30.             parameters you pass)
  31.   -108  Not enough memory to load voice into memory
  32.   -241  Could not open another speech synthesizer channel    (perhaps
  33.            already opened?)
  34.   -244  Voice resource not found
  35.  
  36.  
  37.  
  38.